package ace.cmp.security.oauth2.resource.server.core.annotation;

import ace.cmp.security.oauth2.resource.server.core.constant.Oauth2ResourceServerConstant;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.security.access.prepost.PreAuthorize;

/**
 * @author caspar
 * @date 2023/3/23 15:09 是否具有用户角色范围权限
 */
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
@PreAuthorize("@securityService.hasAuthority('" + Oauth2ResourceServerConstant.SCOPE_USERINFO + "')")
public @interface PreAuthorizeIsUserAuthenticated {

}
